<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:jsp="http://java.sun.com/JSP/Page"
	xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core" xmlns:a4j="http://richfaces.org/a4j" xmlns:rich="http://richfaces.org/rich">
	<jsp:directive.page language="java" import="java.util.*" pageEncoding="UTF-8" />
	<ui:composition template="/protected/layout/template.xhtml">
		<head>
			<ui:define name="head">
				<title><h:outputText value="#{backApp.fullTitle}" />Manutenção de Cadastro!</title>
			</ui:define>
		</head>
		<body>
			<ui:define name="body">
				<rich:panel>
					<f:facet name="header">
						<h3 align="center">
							Manutenção de Cadastro
						</h3>
					</f:facet>
					<rich:panel id="userPanel">
						<f:facet name="header">
							<h4 align="center">
								Dados do Usuário
							</h4>
						</f:facet>
						<h:form prependId="false">
							<h:panelGrid columns="3">
								<rich:column colspan="1">
									<h:outputLabel for="tfReduzedId" value="Id Reduzido:"
										title="Id Reduzido pode ser utilizado para identificar rapidamente o Usuário" />
									<br />
									<h:panelGroup>
										<h:inputText size="6" id="tfReduzedId" required="false" rendered="true"
											value="#{userRecordsManager.user.reduzedId}" maxlength="6" />
										<h:message for="tfReduzedId" />
									</h:panelGroup>
								</rich:column>
								<rich:column colspan="1">
									<h:outputLabel for="tfUUID" value="UUID:" />
									<br />
									<h:inputText readonly="true" size="50" id="tfUUID" required="true" rendered="true"
										value="#{userRecordsManager.user.registrationId}" />
								</rich:column>
								<rich:column colspan="1">
									<h:outputLabel for="tfUserAka" value="Apelido (Como gosta de ser chamado):" />
									<br />
									<h:panelGroup>
										<h:inputText size="20" id="tfUserAka" required="false" value="#{userRecordsManager.user.aka}" />
										<h:message for="tfUserAka" />
									</h:panelGroup>
								</rich:column>
								<rich:column colspan="4">
									<h:outputLabel for="tfUserName" value="Nome:" />
									<br />
									<h:panelGroup>
										<h:inputText size="60" id="tfUserName" required="true" rendered="true" value="#{userRecordsManager.user.name}" />
										<h:message for="tfUserName" />
									</h:panelGroup>
								</rich:column>
								<rich:spacer />
								<rich:spacer />
								<rich:column colspan="1">
									<h:outputLabel for="tfUserEmail" value="E-mail:" />
									<br />
									<h:panelGroup>
										<h:inputText size="40" id="tfUserEmail" required="true" rendered="true"
											value="#{userRecordsManager.user.email}" />
										<h:message for="tfUserEmail" />
									</h:panelGroup>
								</rich:column>
								<rich:column colspan="1">
									<h:outputLabel for="tfRegistrationDate" value="Data de Registro:" />
									<br />
									<h:panelGroup>
										<h:inputText readonly="true" size="30" id="tfRegistrationDate" required="true" rendered="true"
											value="#{userRecordsManager.user.registrationDate}" />
									</h:panelGroup>
								</rich:column>
								<rich:column colspan="1">
									<h:outputLabel for="tfLastUpdateDate" value="Data Última Atualização:" />
									<br />
									<h:panelGroup>
										<h:inputText readonly="true" size="30" id="tfLastUpdateDate" required="true" rendered="true"
											value="#{userRecordsManager.user.lastUpdateDate}" />
									</h:panelGroup>
								</rich:column>
							</h:panelGrid>
							<rich:spacer height="20" />
							<a4j:region>
								<center>
									<a4j:commandButton id="saveUserButton" value="Salvar" action="#{userRecordsManager.saveBaseUserRecord}"
										status="statusSaveUserButton" reRender="userPanel" />
									<rich:spacer width="20" />
									<h:commandButton value="Restaurar" action="#{loginManager.restoreBaseUserRecord}" type="reset" />
									<br />
									<a4j:status id="statusSaveUserButton" startText="Salvando" stopText="" />
								</center>
							</a4j:region>
						</h:form>
					</rich:panel>
					<rich:panel>
						<h:commandButton value="Listar Endereços" action=#{listUserAddress} />
						<h:commandButton value="Listar Clientes" action=#{listUserClients} />
					</rich:panel>
				</rich:panel>
			</ui:define>
		</body>
	</ui:composition>
</html>
